package com.dq.mapper;

import com.dq.entity.QQUserLogin;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: Dang Qi
 * @Date: 2021/5/8 15:38
 * @Description:
 */
public interface QQLoginMapper {
    @Select("select * from qq_login where qq_number=#{qqNumber}")
    QQUserLogin selectByNo(@Param("qqNumber") String qqNumber);

    @Select("select * from qq_login")
    List<QQUserLogin> selectAll();

    @Select("select secret from qq_login where qq_number = #{qqNumber}")
    String getSecretByNo(String qqNumber);

    @Update("update qq_login set passwd=#{passwd}, secret=#{secret} where qq_number=#{qqNumber}")
    int updateByNo(QQUserLogin login);

    @Insert("insert into qq_login (qq_number,passwd, secret) values(#{qqNumber},#{passwd},#{secret})")
    int insert(QQUserLogin login);

    @Delete("delete from qq_login where qq_number=#{qqNumber}")
    int deleteByNo(String qqNumber);
}
